package com.bwie.auth.controller;

import com.bwie.auth.service.AuthServicee;
import com.bwie.common.domain.User;
import com.bwie.common.domain.UserDto;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("authh")
@CrossOrigin
public class AuthController {

    @Autowired
    AuthServicee authServicee;


    @PostMapping("send")
    public Result send(@RequestBody User user){
        authServicee.send(user);
        return Result.success();
    }

    @PostMapping("loog")
    public Result loog(@RequestBody User user){
      UserDto userDto= authServicee.loog(user);
      return Result.success(userDto);
    }
}
